#include "shm.hpp"
#include "namedpipe.hpp"

int main()
{
    // 1.创建共享内存
    Shm shm(gpathname, gproj_id, gUser);
    shm.Zero();
    char *addr = (char *)shm.Addr();

    // 2.打开管道
    NamedPipe fifo(comm_path, User);
    fifo.OpenToWrite();

    // 当成字符串
    char ch = 'A';
    while (true)
    {
        addr[ch - 'A'] = ch;
        ch++;

        std::string tmp = "wakeup";
        fifo.WriteNamedPipe(tmp);
        
        sleep(2);
    }

    return 0;
}